﻿using System.Data.Entity.ModelConfiguration;

namespace CS795.TravelAgency.CarRental.Domain.Entities.Configurations
{
    public class ReservationConfiguration : EntityTypeConfiguration<Reservation>
    {
        public ReservationConfiguration()
        {
            HasKey(p => p.Id);
            Property(p => p.Status).IsRequired();
            HasRequired(p => p.Quote).WithMany().HasForeignKey(p => p.QuoteId);
            HasOptional(p => p.Payment).WithMany().HasForeignKey(p => p.PaymentId);
        }
    }
}
